package com.craftcomputing.client.Entry;

import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.ui.*;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.craftcomputing.client.Listeners.EntryPanelListeners.*;

public abstract class EntryPanel extends Composite{
	/**
	* @wbp.parser.constructor
	*/
	public EntryPanel(){
		mainPanel = new VerticalPanel();
		mainPanel.setWidth("700px");
		initWidget(mainPanel);

		horizontalPanel = new HorizontalPanel();
		mainPanel.add(horizontalPanel);
		horizontalPanel.setWidth("100%");
		horizontalPanel.setStyleName("gwt-BreadcrumbBar");

		final HorizontalPanel breadcrumbs = new HorizontalPanel();
		horizontalPanel.add(breadcrumbs);
		horizontalPanel.setCellVerticalAlignment(breadcrumbs, HasVerticalAlignment.ALIGN_MIDDLE);
		horizontalPanel.setCellHeight(breadcrumbs, "40px");
		breadcrumbs.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
		breadcrumbs.setSpacing(2);

		entryLabel.setStyleName("none");
		breadcrumbs.add(entryLabel);
		breadcrumbs.setCellVerticalAlignment(entryLabel, HasVerticalAlignment.ALIGN_MIDDLE);
		entryLabel.setHeight("100%");

		panel.setWidth("700px");
		mainPanel.add(panel);

	}
	public void removeBreadcrumbs()
	{
		mainPanel.remove(horizontalPanel);
	}
	public abstract void updateEntry(JSONValue json);
	public abstract String searchText();
	protected VerticalPanel panel = new VerticalPanel();
	//protected Label entryLabel = new Label("> entry");
	protected HTML entryLabel = new HTML("> entry");
	private VerticalPanel mainPanel;
	private HorizontalPanel horizontalPanel;
	}
